<!DOCTYPE html>
<html>
<head>
    <title>查看--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css"/>
    <link rel="stylesheet" type="text/css" href="../Css/style.css"/>
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>
    <script type="text/javascript" src="../Js/ckeditor/ckeditor.js"></script>


    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
    <script type="text/javascript">
        $(function () {
            $('#backid').click(function () {
                window.location.href = "index.html";
            });
        });
    </script>
</head>
<body>
<form action="index.html" method="post" class="definewidth m20">
    <table class="table table-bordered table-hover definewidth m10">
        <tr>
            <td width="10%" class="tableleft" >姓名</td>
            <td name="dName">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">身份证号</td>
            <td name="dIdcar">

            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">手机</td>
            <td name="dPhone">

            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">座机</td>
            <td name="dTelphone">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">性别</td>
            <td name="dSex">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">年龄</td>
            <td name="dAge">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">出生年月</td>
            <td name="dBirthday">

            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">入职时间</td>
            <td name="dIntime">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">电子邮箱</td>
            <td name="dEmail">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">所属科室</td>
            <td name="dKeshi">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">学历</td>
            <td name="dXueli">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">职业状态</td>
            <td name="dState">
            </td>
        </tr>
        <tr>
            <td width="10%" class="tableleft">备注</td>
            <td name="dDesc">
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <center>
                    <button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
                </center>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
<script type="text/javascript">
    $(function () {
        //根据地址获取doctorId,如果null则执行增加，否则执行更新
        let url = document.location.toString();//获取URL
        let doctorId = url.GetValue("doctorId");

        //根据id回显医生信息到页面
        queryById(doctorId);
    });
    //回显函数
    function queryById(doctorId) {
        $.get("/hospital/doctor/"+doctorId, {} ,function (vo){
            let obj = vo.obj;
            let dId = obj.dId;
            let dName = obj.dName;
            let dIdcar = obj.dIdcar;
            let dPhone = obj.dPhone;
            let dTelphone = obj.dTelphone;
            let dSex = obj.dSex==0?"男":"女";
            let dBirthday = obj.dBirthday;
            let dAge = obj.dAge;
            let dEmail = obj.dEmail;
            let dKeshi = obj.dKeshi;
            let dXueli = obj.dXueli;
            let dDesc = obj.dDesc;
            let dIntime = obj.dIntime;
            let dState = obj.dState==0?"在职":"离职";

            $("td[name='dName']").html(dName);
            $("td[name='dIdcar']").html(dIdcar);
            $("td[name='dPhone']").html(dPhone);
            $("td[name='dTelphone']").html(dTelphone);
            $("td[name='dSex']").html(dSex);
            $("td[name='dBirthday']").html(dBirthday);
            $("td[name='dAge']").html(dAge);
            $("td[name='dEmail']").html(dEmail);
            $("td[name='dKeshi']").html(dKeshi);
            $("td[name='dXueli']").html(dXueli);
            $("td[name='dDesc']").html(dDesc);
            $("td[name='dIntime']").html(dIntime);
            $("td[name='dState']").html(dState);


        },"json");
    }
    String.prototype.GetValue = function (para) {
        let reg = new RegExp("(^|&)" + para + "=([^&]*)(&|$)");
        let r = this.substr(this.indexOf("\?") + 1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }
</script>